import java.util.Random;
import java.util.Scanner;

public class Practice {
    public static void main(String[] args) {
        Random random = new Random();
        int num = random.nextInt(100);
        Scanner scan = new Scanner(System.in);
        while (true) {
            System.out.println("猜数字：");
            int input = scan.nextInt();
            if (input > num) {
                System.out.println("猜大了！");
            } else if (input == num) {
                System.out.println("猜对了！");
                break;
            }else{
                System.out.println("猜小了！");
            }
        }
    }

    public static void main6(String[] args) {50
        for (int i = 0; i < 999999; i++) {
            int count = 1;
            int sum = 0;
            int tem = i;
            while (tem / 10 != 0){
                count++;
                tem /= 10;
            }
            tem = i;
            for (int j = 0; j < count; j++) {
                sum += Math.pow(tem % 10, count);
                tem = tem / 10;
            }
            if (i == sum){
                System.out.print(i + " ");
            }
        }
    }

    public static void main5(String[] args) {
        double sum = 0;
        for (int i = 1; i <= 100; i++) {
            if (i % 2 == 0) {
                sum -= 1.0 / i;
            } else {
                sum += 1.0 / i;
            }
        }
        System.out.println(sum);
    }

    public static void main4(String[] args) {
        int a = 18;
        int b = 12;
        int c = a % b;
        while (c != 0) {
            a = b;
            b = c;
            c = a % b;
        }
        System.out.println(b);
    }

    public static void main3(String[] args) {
        int count = 0;
        for (int i = 1; i < 101; i++) {
            if (i % 10 == 9) {
                count++;
            }
            if (i / 10 == 9) {
                count++;
            }
        }
        System.out.println(count);
    }

    public static void main2(String[] args) {
        for (int i = 1000; i < 2001; i++) {
            if (i % 100 != 0) {
                if (i % 4 == 0) {
                    System.out.print(i + " ");
                }
            } else if (i % 400 == 0) {
                System.out.print(i + " ");
            }
        }
    }

    public static void main1(String[] args) {
        int i, j = 2;
        for (i = 2; i <= 100; i++) {
            for (j = 2; j < i; j++) {
                if (i % j == 0) {
                    break;
                }
            }
            if (j == i) {
                System.out.print(i + " ");
            }
        }
    }
}